package top.xzxsrq.fileviewutils.controller;

import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import top.xzxsrq.fileviewutils.plugin.WatchDir;

@Controller
@Log4j2
public class PageController {

    @Autowired
    private WatchDir watchDir;

    @GetMapping({"/", "/index", "/index.html"})
    public String index(Model model) {
        model.addAttribute("pagePlugins", watchDir.pagePlugins);
        return "index";
    }
}
